using Assets.Scripts.GDK;
using UnityEngine.UI;

namespace Brick
{
	public class DailySevenItem : gdk_base_layer
	{
		public Image qdImage;

		private int splitIndex;

		private DayModel[] _dayInfo;

		public Image[] imageIcons;

		public Text[] iconText;

		public void OnData(DayModel[] dayInfo, bool isSign)
		{
			_dayInfo = dayInfo;
			if (isSign)
			{
				qdImage.gameObject.SetActive(value: true);
			}
			else
			{
				qdImage.gameObject.SetActive(value: false);
			}
			for (int i = 0; i < dayInfo.Length; i++)
			{
				OnShowItem(dayInfo[i], imageIcons[i], iconText[i]);
			}
		}

		public void OnShowItem(DayModel dayInfo, Image images, Text numText)
		{
			numText.text = "x" + dayInfo.rewardCount.ToString();
			if (dayInfo.rewardType == 2)
			{
				images.sprite = gdk_game_manager.loadSprite("UI/Common/common_zs");
			}
			else if (dayInfo.rewardType == 3)
			{
				images.sprite = gdk_game_manager.loadSprite("UI/Game/dj_2");
			}
			else if (dayInfo.rewardType == 4)
			{
				images.sprite = gdk_game_manager.loadSprite("UI/Game/dj_1");
			}
			else if (dayInfo.rewardType == 5)
			{
				images.sprite = gdk_game_manager.loadSprite("UI/Game/dj_5");
			}
			else if (dayInfo.rewardType == 6)
			{
				images.sprite = gdk_game_manager.loadSprite("UI/Game/dj_3");
			}
			else if (dayInfo.rewardType == 7)
			{
				images.sprite = gdk_game_manager.loadSprite("UI/Game/dj_4");
			}
			images.SetNativeSize();
		}

		public void OnSign()
		{
			qdImage.gameObject.SetActive(value: true);
		}
	}
}

